
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module combDither</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>combDither</strong></big></big> (version 1.47)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/meurer/ACS/Pipeline/Apsis/apsis-4.2.4/python/apsis/combDither.py">/home/meurer/ACS/Pipeline/Apsis/apsis-4.2.4/python/apsis/combDither.py</a></font></td></tr></table>
    <p><tt>License<br>
=======<br>
&nbsp;<br>
Copyright&nbsp;(c)&nbsp;2009,&nbsp;The&nbsp;Johns&nbsp;Hopkins&nbsp;University<br>
&nbsp;<br>
All&nbsp;rights&nbsp;reserved.<br>
&nbsp;<br>
Redistribution&nbsp;and&nbsp;use&nbsp;in&nbsp;source&nbsp;and&nbsp;binary&nbsp;forms,&nbsp;with&nbsp;or&nbsp;without<br>
modification,&nbsp;are&nbsp;permitted&nbsp;provided&nbsp;that&nbsp;the&nbsp;following&nbsp;conditions&nbsp;are&nbsp;met:<br>
&nbsp;<br>
Redistributions&nbsp;of&nbsp;source&nbsp;code&nbsp;must&nbsp;retain&nbsp;the&nbsp;above&nbsp;copyright&nbsp;notice,&nbsp;this<br>
list&nbsp;of&nbsp;conditions&nbsp;and&nbsp;the&nbsp;following&nbsp;disclaimer.&nbsp;&nbsp;Redistributions&nbsp;in&nbsp;binary<br>
form&nbsp;must&nbsp;reproduce&nbsp;the&nbsp;above&nbsp;copyright&nbsp;notice,&nbsp;this&nbsp;list&nbsp;of&nbsp;conditions&nbsp;and<br>
the&nbsp;following&nbsp;disclaimer&nbsp;in&nbsp;the&nbsp;documentation&nbsp;and/or&nbsp;other&nbsp;materials&nbsp;provided<br>
with&nbsp;the&nbsp;distribution.&nbsp;&nbsp;Neither&nbsp;the&nbsp;name&nbsp;of&nbsp;the&nbsp;Johns&nbsp;Hopkins&nbsp;University&nbsp;nor<br>
the&nbsp;names&nbsp;of&nbsp;its&nbsp;contributors&nbsp;may&nbsp;be&nbsp;used&nbsp;to&nbsp;endorse&nbsp;or&nbsp;promote&nbsp;products<br>
derived&nbsp;from&nbsp;this&nbsp;software&nbsp;without&nbsp;specific&nbsp;prior&nbsp;written&nbsp;permission.<br>
&nbsp;<br>
THIS&nbsp;SOFTWARE&nbsp;IS&nbsp;PROVIDED&nbsp;BY&nbsp;THE&nbsp;COPYRIGHT&nbsp;HOLDERS&nbsp;AND&nbsp;CONTRIBUTORS&nbsp;'AS<br>
IS'&nbsp;AND&nbsp;ANY&nbsp;EXPRESS&nbsp;OR&nbsp;IMPLIED&nbsp;WARRANTIES,&nbsp;INCLUDING,&nbsp;BUT&nbsp;NOT&nbsp;LIMITED<br>
TO,&nbsp;THE&nbsp;IMPLIED&nbsp;WARRANTIES&nbsp;OF&nbsp;MERCHANTABILITY&nbsp;AND&nbsp;FITNESS&nbsp;FOR&nbsp;A<br>
PARTICULAR&nbsp;PURPOSE&nbsp;ARE&nbsp;DISCLAIMED.&nbsp;IN&nbsp;NO&nbsp;EVENT&nbsp;SHALL&nbsp;THE&nbsp;COPYRIGHT<br>
HOLDER&nbsp;OR&nbsp;CONTRIBUTORS&nbsp;BE&nbsp;LIABLE&nbsp;FOR&nbsp;ANY&nbsp;DIRECT,&nbsp;INDIRECT,&nbsp;INCIDENTAL,<br>
SPECIAL,&nbsp;EXEMPLARY,&nbsp;OR&nbsp;CONSEQUENTIAL&nbsp;DAMAGES&nbsp;(INCLUDING,&nbsp;BUT&nbsp;NOT&nbsp;LIMITED<br>
TO,&nbsp;PROCUREMENT&nbsp;OF&nbsp;SUBSTITUTE&nbsp;GOODS&nbsp;OR&nbsp;SERVICES;&nbsp;LOSS&nbsp;OF&nbsp;USE,&nbsp;DATA,&nbsp;OR<br>
PROFITS;&nbsp;OR&nbsp;BUSINESS&nbsp;INTERRUPTION)&nbsp;HOWEVER&nbsp;CAUSED&nbsp;AND&nbsp;ON&nbsp;ANY&nbsp;THEORY&nbsp;OF<br>
LIABILITY,&nbsp;WHETHER&nbsp;IN&nbsp;CONTRACT,&nbsp;STRICT&nbsp;LIABILITY,&nbsp;OR&nbsp;TORT&nbsp;(INCLUDING<br>
NEGLIGENCE&nbsp;OR&nbsp;OTHERWISE)&nbsp;ARISING&nbsp;IN&nbsp;ANY&nbsp;WAY&nbsp;OUT&nbsp;OF&nbsp;THE&nbsp;USE&nbsp;OF&nbsp;THIS<br>
SOFTWARE,&nbsp;EVEN&nbsp;IF&nbsp;ADVISED&nbsp;OF&nbsp;THE&nbsp;POSSIBILITY&nbsp;OF&nbsp;SUCH&nbsp;DAMAGE.<br>
&nbsp;<br>
(This&nbsp;license&nbsp;is&nbsp;based&nbsp;on&nbsp;the&nbsp;BSD&nbsp;license<br>
&nbsp;<a href="http://www.opensource.org/licenses/bsd-license.html">http://www.opensource.org/licenses/bsd-license.html</a>)</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="astrometer.html">astrometer</a><br>
<a href="augmask.html">augmask</a><br>
<a href="fUtil.html">fUtil</a><br>
<a href="glob.html">glob</a><br>
</td><td width="25%" valign=top><a href="math.html">math</a><br>
<a href="matutil.html">matutil</a><br>
<a href="numpy.html">numpy</a><br>
<a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="pyblot.html">pyblot</a><br>
<a href="pyfits.html">pyfits</a><br>
<a href="pyraf.html">pyraf</a><br>
<a href="string.html">string</a><br>
</td><td width="25%" valign=top><a href="xmlUtil.html">xmlUtil</a><br>
<a href="xydrizzle.html">xydrizzle</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="combDither.html#drizzleImage">drizzleImage</a>
</font></dt></dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="drizzleImage">class <strong>drizzleImage</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Some&nbsp;notes&nbsp;on&nbsp;the&nbsp;combDither&nbsp;module&nbsp;and&nbsp;its&nbsp;implementation&nbsp;of&nbsp;xydrizzle.<br>
&nbsp;<br>
combDither&nbsp;currently&nbsp;contains&nbsp;one&nbsp;class,&nbsp;<a href="#drizzleImage">drizzleImage</a>,&nbsp;which&nbsp;defines<br>
methods&nbsp;for&nbsp;drizzling&nbsp;dithered&nbsp;image&nbsp;associations&nbsp;to&nbsp;a&nbsp;final&nbsp;images,<br>
including&nbsp;cosmic&nbsp;ray&nbsp;rejection,&nbsp;etc.&nbsp;&nbsp;The&nbsp;original&nbsp;intention&nbsp;was&nbsp;to<br>
create&nbsp;other&nbsp;classes&nbsp;with&nbsp;methods&nbsp;for&nbsp;combining&nbsp;the&nbsp;images&nbsp;using&nbsp;other<br>
routines&nbsp;(e.g.,&nbsp;SWARP,&nbsp;or&nbsp;something&nbsp;based&nbsp;on&nbsp;python&nbsp;numerical&nbsp;arrays).<br>
&nbsp;<br>
The&nbsp;basic&nbsp;procedure&nbsp;for&nbsp;processing&nbsp;a&nbsp;dataset&nbsp;through&nbsp;drizzle:<br>
&nbsp;<br>
drob&nbsp;=&nbsp;<a href="#drizzleImage">drizzleImage</a>(obs,al.MatchDict)&nbsp;-&nbsp;create&nbsp;instance&nbsp;of&nbsp;this&nbsp;class<br>
drob.<a href="#drizzleImage-run_all">run_all</a>()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;run&nbsp;the&nbsp;drizzle/blot/drizzle&nbsp;sequence<br>
drob.<a href="#drizzleImage-makeFlagImage">makeFlagImage</a>()&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;create&nbsp;Sextractor&nbsp;flag&nbsp;image&nbsp;for&nbsp;each&nbsp;asn<br>
drob.<a href="#drizzleImage-makeRmsImage">makeRmsImage</a>()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;create&nbsp;Sextractor&nbsp;rms&nbsp;image&nbsp;for&nbsp;each&nbsp;asn<br>
drob.<a href="#drizzleImage-fixAstrometry">fixAstrometry</a>(obs)&nbsp;-&nbsp;&nbsp;&nbsp;fix&nbsp;the&nbsp;astrometry&nbsp;of&nbsp;the&nbsp;images&nbsp;if&nbsp;possible.<br>
&nbsp;<br>
[The&nbsp;fixAstrometry&nbsp;method&nbsp;must&nbsp;receive&nbsp;a&nbsp;DataSet&nbsp;object&nbsp;(obs)&nbsp;and&nbsp;will&nbsp;generally<br>
be&nbsp;called&nbsp;by&nbsp;the&nbsp;apsis&nbsp;pipeline.&nbsp;&nbsp;This&nbsp;behaviour&nbsp;is&nbsp;not&nbsp;internally&nbsp;consistent<br>
but&nbsp;the&nbsp;method&nbsp;is&nbsp;a&nbsp;bit&nbsp;of&nbsp;hack&nbsp;to&nbsp;removed&nbsp;the&nbsp;need&nbsp;for&nbsp;the&nbsp;pipeline&nbsp;to<br>
deal&nbsp;with&nbsp;a&nbsp;new&nbsp;object&nbsp;(an&nbsp;instance&nbsp;of&nbsp;astrometer.gscMatchup)&nbsp;and&nbsp;all&nbsp;the<br>
attendant&nbsp;messaging&nbsp;for&nbsp;that.&nbsp;&nbsp;N.B.&nbsp;This&nbsp;method&nbsp;should&nbsp;not&nbsp;be&nbsp;called&nbsp;internally.]<br>
&nbsp;<br>
Alternatively,&nbsp;the&nbsp;user&nbsp;can&nbsp;replace&nbsp;<a href="#drizzleImage-run_all">run_all</a>()&nbsp;with&nbsp;<a href="#drizzleImage-run_drizzle">run_drizzle</a>()&nbsp;if&nbsp;no<br>
cosmic&nbsp;ray&nbsp;rejection&nbsp;is&nbsp;desired.&nbsp;&nbsp;This&nbsp;module&nbsp;no&nbsp;longer&nbsp;makes&nbsp;its&nbsp;own<br>
association&nbsp;tables,&nbsp;but&nbsp;just&nbsp;uses&nbsp;the&nbsp;original&nbsp;ones&nbsp;that&nbsp;are&nbsp;given&nbsp;as<br>
inputs&nbsp;to&nbsp;the&nbsp;pipeline.<br>
&nbsp;<br>
The&nbsp;run_all&nbsp;method&nbsp;does&nbsp;three&nbsp;things:<br>
&nbsp;<br>
1.&nbsp;<a href="#drizzleImage-run_drizzle">run_drizzle</a>()&nbsp;drizzles&nbsp;images&nbsp;onto&nbsp;separate&nbsp;output&nbsp;images<br>
2.&nbsp;runs&nbsp;pyblot&nbsp;(median&nbsp;stacks,&nbsp;blots,&nbsp;derivs,&nbsp;cr_rej)&nbsp;which<br>
&nbsp;&nbsp;&nbsp;&nbsp;returns&nbsp;the&nbsp;list&nbsp;of&nbsp;cr&nbsp;masks&nbsp;for&nbsp;2nd&nbsp;drizzling<br>
3.&nbsp;<a href="#drizzleImage-run_drizzle">run_drizzle</a>()&nbsp;to&nbsp;drizzles&nbsp;images&nbsp;all&nbsp;together&nbsp;using&nbsp;CR&nbsp;masks<br>
&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;pyblot<br>
&nbsp;<br>
<a href="#drizzleImage-run_drizzle">run_drizzle</a>()&nbsp;is&nbsp;the&nbsp;heart&nbsp;of&nbsp;the&nbsp;<a href="#drizzleImage">drizzleImage</a>&nbsp;class.&nbsp;&nbsp;It&nbsp;runs&nbsp;pydrizzle<br>
on&nbsp;all&nbsp;of&nbsp;the&nbsp;association&nbsp;tables&nbsp;in&nbsp;the&nbsp;asnTableList&nbsp;and&nbsp;takes&nbsp;a&nbsp;number<br>
of&nbsp;optional&nbsp;parameters&nbsp;(outshape=None,&nbsp;deltmp=1,&nbsp;units='counts',<br>
bits=_goodBits_,&nbsp;separDriz=0,&nbsp;crmasks=None,&nbsp;exptimePyDrKludge=0).<br>
Here's&nbsp;what&nbsp;the&nbsp;params&nbsp;are&nbsp;for<br>
&nbsp;<br>
outshape:&nbsp;&nbsp;x,y&nbsp;sizes&nbsp;of&nbsp;output&nbsp;drizzled&nbsp;image&nbsp;(def:&nbsp;determined&nbsp;'otf')<br>
deltmp:&nbsp;&nbsp;&nbsp;&nbsp;delete&nbsp;temporary&nbsp;(masks,&nbsp;coeffs)&nbsp;files?&nbsp;(def:&nbsp;1&nbsp;[yes])<br>
units:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;units&nbsp;of&nbsp;output&nbsp;pixel&nbsp;values&nbsp;(def:&nbsp;counts)<br>
bits:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sum&nbsp;of&nbsp;all&nbsp;possible&nbsp;good-pixel&nbsp;values&nbsp;in&nbsp;dq&nbsp;array<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('None'&nbsp;means&nbsp;don't&nbsp;use&nbsp;masks).<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;default&nbsp;value&nbsp;bits=8450&nbsp;is&nbsp;the&nbsp;sum&nbsp;of&nbsp;the&nbsp;pix&nbsp;values<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;that&nbsp;we&nbsp;accept&nbsp;as&nbsp;being&nbsp;good,&nbsp;bits&nbsp;=&nbsp;0+2+256+8192&nbsp;=&nbsp;8450,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;includes&nbsp;'good',&nbsp;'replaced',&nbsp;'saturated',and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'CR-repaired',&nbsp;but&nbsp;NOTE&nbsp;THAT&nbsp;THESE&nbsp;VALUES&nbsp;ARE&nbsp;PARTICULAR&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TO&nbsp;CALACS!&nbsp;[ISR&nbsp;ACS-99-03]<br>
&nbsp;<br>
The&nbsp;remainder&nbsp;of&nbsp;the&nbsp;params&nbsp;relate&nbsp;to&nbsp;pyblot&nbsp;setup&nbsp;and&nbsp;results:<br>
crmasks:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List&nbsp;of&nbsp;(mask,nzap)&nbsp;tuples&nbsp;from&nbsp;pyblot<br>
separDriz:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Drizzle&nbsp;onto&nbsp;separate&nbsp;output&nbsp;images?<br>
&nbsp;<br>
run_drizzle&nbsp;loops&nbsp;over&nbsp;all&nbsp;associations&nbsp;and&nbsp;runs&nbsp;pydrizzle&nbsp;on&nbsp;them.&nbsp;&nbsp;<br>
It&nbsp;measures&nbsp;the&nbsp;shift&nbsp;'zeropoint'&nbsp;based&nbsp;on&nbsp;the&nbsp;mean&nbsp;of&nbsp;all&nbsp;the&nbsp;measured<br>
shifts&nbsp;and&nbsp;then&nbsp;sets&nbsp;the&nbsp;relative&nbsp;shifts&nbsp;accordingly,&nbsp;ensuring&nbsp;that&nbsp;all<br>
associations&nbsp;will&nbsp;have&nbsp;the&nbsp;same&nbsp;absolute&nbsp;shift&nbsp;zeropoint,&nbsp;as&nbsp;well&nbsp;as&nbsp;the<br>
same&nbsp;image&nbsp;size.&nbsp;&nbsp;This&nbsp;*seems*&nbsp;to&nbsp;be&nbsp;ok,&nbsp;although&nbsp;the&nbsp;output&nbsp;WCS&nbsp;may&nbsp;then<br>
disagree&nbsp;with&nbsp;pydrizzle's&nbsp;idea&nbsp;of&nbsp;the&nbsp;WCS&nbsp;of&nbsp;the&nbsp;output&nbsp;product,&nbsp;but&nbsp;drizzle<br>
itself&nbsp;constructs&nbsp;the&nbsp;WCS&nbsp;image&nbsp;in&nbsp;the&nbsp;output&nbsp;product&nbsp;from&nbsp;the&nbsp;input&nbsp;and<br>
whatever&nbsp;image&nbsp;headers&nbsp;it&nbsp;gets.<br>
&nbsp;<br>
For&nbsp;each&nbsp;association,&nbsp;run_drizzle&nbsp;creates&nbsp;the&nbsp;pydrizzle&nbsp;object,&nbsp;then<br>
goes&nbsp;through&nbsp;the&nbsp;parlist&nbsp;(list&nbsp;of&nbsp;dictionaries&nbsp;holding&nbsp;input&nbsp;drizzle<br>
parameters).&nbsp;&nbsp;It&nbsp;modifies&nbsp;these&nbsp;parlists&nbsp;in&nbsp;various&nbsp;way,&nbsp;e.g.,&nbsp;it&nbsp;makes<br>
the&nbsp;output&nbsp;images&nbsp;different&nbsp;if&nbsp;'separDriz'&nbsp;has&nbsp;been&nbsp;set.&nbsp;&nbsp;It&nbsp;also&nbsp;sets<br>
the&nbsp;x,y&nbsp;shifts&nbsp;and&nbsp;rotations&nbsp;to&nbsp;whatever&nbsp;is&nbsp;in&nbsp;the&nbsp;MatchDict&nbsp;(thus,<br>
making&nbsp;delta&nbsp;shifts&nbsp;in&nbsp;the&nbsp;asn&nbsp;tables&nbsp;no&nbsp;longer&nbsp;necessary).&nbsp;&nbsp;The&nbsp;list&nbsp;of<br>
modified&nbsp;parlists&nbsp;is&nbsp;saved&nbsp;as&nbsp;a&nbsp;class&nbsp;attribute.&nbsp;&nbsp;It&nbsp;then&nbsp;runs&nbsp;drizzle.<br>
&nbsp;<br>
After&nbsp;the&nbsp;2nd&nbsp;drizzle&nbsp;(separdriz&nbsp;=&nbsp;0),&nbsp;the&nbsp;code&nbsp;checks&nbsp;if:<br>
(1)&nbsp;the&nbsp;number&nbsp;of&nbsp;science&nbsp;extensions&nbsp;in&nbsp;the&nbsp;multi-extension&nbsp;FITS&nbsp;(mef)<br>
file&nbsp;is&nbsp;greater&nbsp;than&nbsp;1&nbsp;and&nbsp;units='counts'&nbsp;(the&nbsp;default);&nbsp;if&nbsp;so,&nbsp;it<br>
divides&nbsp;the&nbsp;count&nbsp;levels&nbsp;by&nbsp;the&nbsp;number&nbsp;of&nbsp;extensions.<br>
(2)&nbsp;if&nbsp;the&nbsp;pydrizzle&nbsp;version&nbsp;is&nbsp;less&nbsp;than&nbsp;1.4;&nbsp;if&nbsp;so&nbsp;and&nbsp;Nsci&gt;1,&nbsp;then&nbsp;it<br>
divides&nbsp;the&nbsp;output&nbsp;exposure&nbsp;times&nbsp;by&nbsp;the&nbsp;number&nbsp;of&nbsp;science&nbsp;extensions.<br>
&nbsp;<br>
If&nbsp;it's&nbsp;the&nbsp;final&nbsp;drizzle,&nbsp;then&nbsp;it&nbsp;also&nbsp;goes&nbsp;through&nbsp;all&nbsp;the&nbsp;input&nbsp;images<br>
and&nbsp;sums&nbsp;the&nbsp;alignSky&nbsp;values&nbsp;in&nbsp;the&nbsp;headers&nbsp;and&nbsp;writes&nbsp;the&nbsp;sum&nbsp;to&nbsp;the<br>
science&nbsp;image&nbsp;header.&nbsp;&nbsp;That's&nbsp;it.&nbsp;&nbsp;The&nbsp;makeFlagImage&nbsp;and&nbsp;makeRmsImage<br>
methods&nbsp;are&nbsp;pretty&nbsp;straightforward.<br>
&nbsp;<br>
The&nbsp;drizzle&nbsp;kernel,&nbsp;for&nbsp;the&nbsp;*final&nbsp;drizzle&nbsp;only*&nbsp;can&nbsp;now&nbsp;be&nbsp;set&nbsp;when<br>
run_drizzle&nbsp;or&nbsp;run_all&nbsp;is&nbsp;called.&nbsp;The&nbsp;drizzle-default&nbsp;linear&nbsp;('square')<br>
kernel&nbsp;is&nbsp;the&nbsp;fastest,&nbsp;and&nbsp;tends&nbsp;to&nbsp;smooth&nbsp;over&nbsp;bad&nbsp;pixels&nbsp;better,<br>
but&nbsp;the&nbsp;psf&nbsp;is&nbsp;not&nbsp;as&nbsp;tight&nbsp;and&nbsp;the&nbsp;noise&nbsp;correlation&nbsp;is&nbsp;much&nbsp;worse.<br>
&nbsp;<br>
The&nbsp;damped&nbsp;sinc&nbsp;interpolant&nbsp;('lanczos3')&nbsp;is&nbsp;sometimes&nbsp;called&nbsp;the<br>
optimal&nbsp;kernel,&nbsp;though&nbsp;beware&nbsp;that&nbsp;you&nbsp;may&nbsp;get&nbsp;holes&nbsp;(negative<br>
pixels)&nbsp;in&nbsp;the&nbsp;output.&nbsp;&nbsp;These&nbsp;holes&nbsp;can&nbsp;happen&nbsp;anywhere,&nbsp;though&nbsp;more<br>
commonly&nbsp;near&nbsp;stars,&nbsp;etc.&nbsp;&nbsp;Because&nbsp;of&nbsp;the&nbsp;masking&nbsp;of&nbsp;bad&nbsp;pixels&nbsp;and<br>
columns&nbsp;(based&nbsp;on&nbsp;the&nbsp;DQ&nbsp;array),&nbsp;occasionally&nbsp;a&nbsp;pixel&nbsp;in&nbsp;the&nbsp;output<br>
image&nbsp;will&nbsp;have&nbsp;very&nbsp;little&nbsp;data&nbsp;from&nbsp;the&nbsp;input&nbsp;image,&nbsp;and&nbsp;by&nbsp;a<br>
quirk&nbsp;of&nbsp;the&nbsp;interpolation&nbsp;kernel&nbsp;with&nbsp;its&nbsp;negative&nbsp;sidelobes,&nbsp;will<br>
end&nbsp;up&nbsp;with&nbsp;a&nbsp;negative&nbsp;value.&nbsp;&nbsp;Richard&nbsp;Hook&nbsp;said&nbsp;to&nbsp;check&nbsp;the<br>
drizzle&nbsp;weight&nbsp;image&nbsp;to&nbsp;make&nbsp;sure&nbsp;that&nbsp;those&nbsp;negative&nbsp;pixels&nbsp;are<br>
given&nbsp;very&nbsp;little&nbsp;weight;&nbsp;if&nbsp;they&nbsp;have&nbsp;low&nbsp;weight,&nbsp;just&nbsp;don't&nbsp;use<br>
them,&nbsp;but&nbsp;if&nbsp;their&nbsp;weight&nbsp;is&nbsp;high,&nbsp;then&nbsp;there&nbsp;might&nbsp;be&nbsp;a&nbsp;problem.<br>
I&nbsp;checked&nbsp;several&nbsp;of&nbsp;these&nbsp;pixels,&nbsp;and&nbsp;found&nbsp;they&nbsp;were&nbsp;given&nbsp;low<br>
weight,&nbsp;about&nbsp;1/10&nbsp;of&nbsp;the&nbsp;median,&nbsp;so&nbsp;it&nbsp;seems&nbsp;ok.&nbsp;&nbsp;Of&nbsp;course,&nbsp;if<br>
there&nbsp;are&nbsp;multiple&nbsp;dithered&nbsp;images,&nbsp;these&nbsp;negative&nbsp;pixels&nbsp;get&nbsp;filled<br>
in&nbsp;quickly&nbsp;by&nbsp;other&nbsp;pixels&nbsp;with&nbsp;much&nbsp;higher&nbsp;weight.&nbsp;&nbsp;For&nbsp;the&nbsp;linear<br>
kernel&nbsp;you&nbsp;don't&nbsp;get&nbsp;this&nbsp;effect&nbsp;because&nbsp;there&nbsp;are&nbsp;no&nbsp;negative<br>
sidelobes.<br>
&nbsp;<br>
One&nbsp;caveat:&nbsp;run_drizzle&nbsp;overwrites&nbsp;shifts,&nbsp;rotations,&nbsp;and&nbsp;output&nbsp;product<br>
names&nbsp;in&nbsp;the&nbsp;pydrizzle&nbsp;parlist&nbsp;rather&nbsp;than&nbsp;setting&nbsp;them&nbsp;through&nbsp;methods.<br>
This&nbsp;was&nbsp;historically&nbsp;necessary&nbsp;for&nbsp;the&nbsp;shifts&nbsp;(and&nbsp;*still*&nbsp;the&nbsp;most<br>
straightforward&nbsp;way),&nbsp;and&nbsp;it's&nbsp;still&nbsp;necessary&nbsp;for&nbsp;drizzling&nbsp;onto<br>
separate&nbsp;outputs&nbsp;for&nbsp;blotting.&nbsp;&nbsp;So,&nbsp;I&nbsp;wouldn't&nbsp;recommend&nbsp;changing&nbsp;it,<br>
but&nbsp;we&nbsp;have&nbsp;to&nbsp;be&nbsp;careful&nbsp;in&nbsp;case&nbsp;later&nbsp;pydrizzles&nbsp;change&nbsp;the&nbsp;parlist<br>
elements&nbsp;or&nbsp;their&nbsp;meanings.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="drizzleImage-__init__"><strong>__init__</strong></a>(self, obs, MatchDict, alignSky<font color="#909090">='ALIGNSKY'</font>, hdrGain<font color="#909090">=0</font>, suppInstVar<font color="#909090">=1</font>, crlower<font color="#909090">=None</font>, smartstack<font color="#909090">=0</font>, notrim<font color="#909090">=0</font>, padfac<font color="#909090">=None</font>, outsize<font color="#909090">=None</font>, outshift<font color="#909090">=None</font>, origscale<font color="#909090">=None</font>, noContext<font color="#909090">=None</font>, maskFile<font color="#909090">=None</font>, dfilts<font color="#909090">=(None, None)</font>)</dt></dl>

<dl><dt><a name="drizzleImage-fixAstrometry"><strong>fixAstrometry</strong></a>(self, obs)</dt><dd><tt>Method&nbsp;to&nbsp;call&nbsp;the&nbsp;astrometer&nbsp;module's&nbsp;stuff&nbsp;and&nbsp;do&nbsp;the&nbsp;astrometric&nbsp;corrections.<br>
The&nbsp;astrometer&nbsp;constructor&nbsp;needs&nbsp;to&nbsp;receive&nbsp;the&nbsp;obs&nbsp;(i.e.&nbsp;DataSet)&nbsp;object.</tt></dd></dl>

<dl><dt><a name="drizzleImage-help"><strong>help</strong></a>(self)</dt></dl>

<dl><dt><a name="drizzleImage-makeFlagImage"><strong>makeFlagImage</strong></a>(self)</dt><dd><tt>turns&nbsp;the&nbsp;weight&nbsp;images&nbsp;produced&nbsp;by&nbsp;drizzle&nbsp;into&nbsp;flag&nbsp;images&nbsp;that<br>
SExtractor&nbsp;will&nbsp;use.</tt></dd></dl>

<dl><dt><a name="drizzleImage-makeRmsImage"><strong>makeRmsImage</strong></a>(self)</dt><dd><tt>turns&nbsp;the&nbsp;drizzled&nbsp;weight&nbsp;images&nbsp;into&nbsp;RMS&nbsp;images&nbsp;that<br>
SExtractor&nbsp;will&nbsp;use.</tt></dd></dl>

<dl><dt><a name="drizzleImage-mkMsg"><strong>mkMsg</strong></a>(self)</dt><dd><tt>create&nbsp;and&nbsp;write&nbsp;module&nbsp;level&nbsp;message&nbsp;for&nbsp;this&nbsp;class.<br>
Most&nbsp;of&nbsp;this&nbsp;is&nbsp;just&nbsp;compiling&nbsp;the&nbsp;info.&nbsp;meta&nbsp;in&nbsp;a&nbsp;dictionary<br>
of&nbsp;lists&nbsp;where&nbsp;each&nbsp;list&nbsp;is&nbsp;a&nbsp;list&nbsp;of&nbsp;tuples&nbsp;describing&nbsp;the<br>
tag&nbsp;lines&nbsp;for&nbsp;the&nbsp;particular&nbsp;section&nbsp;of&nbsp;the&nbsp;message.&nbsp;&nbsp;This&nbsp;tuple&nbsp;<br>
format&nbsp;conforms&nbsp;to&nbsp;that&nbsp;used&nbsp;by&nbsp;the&nbsp;xmlMessage&nbsp;class&nbsp;which&nbsp;is<br>
modeled&nbsp;on&nbsp;basic&nbsp;python&nbsp;argument&nbsp;passing,&nbsp;i.e.&nbsp;(key,*value,**attr).<br>
&nbsp;&nbsp;&nbsp;&nbsp;outscale,pixfrac&nbsp;now&nbsp;converted&nbsp;to&nbsp;string&nbsp;-&nbsp;GRM&nbsp;following&nbsp;Magee</tt></dd></dl>

<dl><dt><a name="drizzleImage-printParlist"><strong>printParlist</strong></a>(self, parlist)</dt><dd><tt>takes&nbsp;a&nbsp;PyDrizzle&nbsp;parlist&nbsp;and&nbsp;prints&nbsp;out&nbsp;the&nbsp;contents</tt></dd></dl>

<dl><dt><a name="drizzleImage-run_all"><strong>run_all</strong></a>(self, clean_up<font color="#909090">=0</font>, userKeepBits<font color="#909090">=None</font>, units<font color="#909090">='counts'</font>, asecpix<font color="#909090">=None</font>, pixfrac<font color="#909090">=None</font>, kernel<font color="#909090">=None</font>, noRej<font color="#909090">=None</font>)</dt><dd><tt>Run_all()<br>
This&nbsp;is&nbsp;it,&nbsp;the&nbsp;whole&nbsp;enchilada:&nbsp;drizzle,&nbsp;blot,&nbsp;drizzle&nbsp;again.</tt></dd></dl>

<dl><dt><a name="drizzleImage-run_drizzle"><strong>run_drizzle</strong></a>(self, outshape<font color="#909090">=None</font>, deltmp<font color="#909090">=1</font>, units<font color="#909090">='counts'</font>, bits<font color="#909090">=14658</font>, separDriz<font color="#909090">=0</font>, crmasks<font color="#909090">=None</font>, asecpix<font color="#909090">=None</font>, pixfrac<font color="#909090">=None</font>, kernel<font color="#909090">='square'</font>, delwght<font color="#909090">=0</font>)</dt><dd><tt><a href="#drizzleImage-run_drizzle">run_drizzle</a>():<br>
Run&nbsp;drizzle&nbsp;on&nbsp;all&nbsp;asn&nbsp;tables&nbsp;in&nbsp;the&nbsp;obsAsnDict.keys()<br>
&nbsp;&nbsp;&nbsp;Input&nbsp;parameters&nbsp;(all&nbsp;optional)&nbsp;include:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;outshape:&nbsp;x,y&nbsp;sizes&nbsp;of&nbsp;output&nbsp;drizzled&nbsp;image&nbsp;(def:&nbsp;determined&nbsp;'otf')<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deltmp:&nbsp;&nbsp;&nbsp;delete&nbsp;temporary&nbsp;(masks,&nbsp;coeffs)&nbsp;files&nbsp;(def:&nbsp;1&nbsp;[yes])<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;units:&nbsp;&nbsp;&nbsp;&nbsp;units&nbsp;of&nbsp;output&nbsp;pixel&nbsp;values&nbsp;(def:&nbsp;counts)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bits:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sum&nbsp;of&nbsp;possible&nbsp;good-pixel&nbsp;values&nbsp;in&nbsp;dq&nbsp;array&nbsp;(None&nbsp;=&gt;&nbsp;don't&nbsp;use&nbsp;masks).<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;default&nbsp;bits=8578&nbsp;is&nbsp;the&nbsp;sum&nbsp;of&nbsp;the&nbsp;pix&nbsp;values&nbsp;that&nbsp;we&nbsp;accept<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as&nbsp;being&nbsp;good,&nbsp;bits&nbsp;=&nbsp;0+2+256+8192+128&nbsp;=&nbsp;8578,&nbsp;which&nbsp;includes<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'good',&nbsp;'replaced',&nbsp;'saturated',&nbsp;'CR-repaired'&nbsp;and&nbsp;'bias-level&nbsp;pixel'&nbsp;but<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NOTE&nbsp;THAT&nbsp;THESE&nbsp;VALUES&nbsp;ARE&nbsp;PARTICULAR&nbsp;TO&nbsp;CALACS!&nbsp;[ISR&nbsp;ACS-99-03]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;remainder&nbsp;of&nbsp;the&nbsp;params&nbsp;relate&nbsp;to&nbsp;pyblot&nbsp;setup&nbsp;and&nbsp;results:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;crmasks:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List&nbsp;of&nbsp;masks&nbsp;from&nbsp;pyblot<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;separDriz:&nbsp;&nbsp;&nbsp;&nbsp;Drizzle&nbsp;onto&nbsp;separate&nbsp;output&nbsp;images<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;asecpix:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Scale&nbsp;in&nbsp;arsec/pix&nbsp;of&nbsp;final&nbsp;drizzled&nbsp;images.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pixfrac:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Drizzle&nbsp;'pixfrac'&nbsp;or&nbsp;'dropsize'&nbsp;parameter.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kernel:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interpolation&nbsp;kernel&nbsp;used&nbsp;by&nbsp;drizzle.</tt></dd></dl>

<dl><dt><a name="drizzleImage-writeXml"><strong>writeXml</strong></a>(self)</dt><dd><tt>mark&nbsp;up&nbsp;products&nbsp;as&nbsp;xml.</tt></dd></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>__author__</strong> = 'J Blakeslee &lt;jpb@pha.jhu.edu&gt;'<br>
<strong>__version__</strong> = '1.47'<br>
<strong>__version_date__</strong> = '2006/08/29 06:50:33'<br>
<strong>dither</strong> = &lt;IrafPkg dither (dither$dither.cl) Pkg: analysis Bin: stsdasbin$&gt;<br>
<strong>drversion</strong> = '3.4.2'<br>
<strong>iraf</strong> = &lt;module 'pyraf.iraf' from '/usr/lib/python2.4/site-packages/pyraf/iraf.pyc'&gt;<br>
<strong>pydriz_version</strong> = '2.6.2 (14-Jul-2006)'<br>
<strong>pyversion</strong> = '2.4.3 (#1, Jan 14 2008, 18:32:40) <font color="#c040c0">\n</font>[GCC 4.1.2 20070626 (Red Hat 4.1.2-14)]'<br>
<strong>stsdas</strong> = &lt;IrafPkg stsdas (stsdas$stsdas.cl) Pkg: clpackage Bin: bin$&gt;<br>
<strong>version</strong> = '2.4.3 (#1, Jan 14 2008, 18:32:40) <font color="#c040c0">\n</font>[GCC 4.1.2 20070626 (Red Hat 4.1.2-14)]'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">J&nbsp;Blakeslee&nbsp;&lt;jpb@pha.jhu.edu&gt;</td></tr></table>
</body></html>